package com.doge.walknovel.business.reader.viewholders

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.doge.walknovel.api.model.ChapterInfo
import com.doge.walknovel.core.base.adapters.AdapterCallback
import com.doge.wnpro.databinding.CellReaderTextChapterTitleBinding
import com.doge.walknovel.utils.html

class ChapterTitleViewHolder(
    parent: ViewGroup,
    callback: AdapterCallback,
    private val binding: CellReaderTextChapterTitleBinding = CellReaderTextChapterTitleBinding.inflate(
        LayoutInflater.from(parent.context), parent, false),
) : RecyclerView.ViewHolder(binding.root) {
    fun bind(item: ChapterInfo) {
        itemView.tag = item
        binding.chapterName.text = item.chapterTitle.html
        binding.chapterName.typeface = item.appTypeface
    }
}